package org.infosec.lc.exercises.SystemAndFileProperties;

import java.io.File;
import java.io.InputStream;

import org.springframework.security.core.userdetails.User;

/**
	文件名：SystemAndFilePropertie.java
	作  者：林超
	时  间：2011-7-11上午10:39:12

	功能描述：Java调用系统和文件属性
		 * <dt>java.version		<dd>Java version number
	     * <dt>java.vendor		<dd>Java vendor specific string
	     * <dt>java.vendor.url	<dd>Java vendor URL
	     * <dt>java.home		<dd>Java installation directory
	     * <dt>java.class.version	<dd>Java class version number
	     * <dt>java.class.path	<dd>Java classpath
	     * <dt>os.name		<dd>Operating System Name
	     * <dt>os.arch		<dd>Operating System Architecture
	     * <dt>os.version		<dd>Operating System Version
	     * <dt>file.separator	<dd>File separator ("/" on Unix)
	     * <dt>path.separator	<dd>Path separator (":" on Unix)
	     * <dt>line.separator	<dd>Line separator ("\n" on Unix)
	     * <dt>user.name		<dd>User account name
	     * <dt>user.home		<dd>User home directory
	     * <dt>user.dir		<dd>User's current working directory
	pom.xml	:
			
 */
public class SystemAndFilePropertie {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		System();
		System.out.println("--------------- 贱贱  的 分割线-------------------");
		File();
	}

	public static void System() {
		System.out.println(System.getProperties()); //所有属性
		System.out.println(System.getProperty("user.dir")); //输出	工程root目录
		
		System.out.println(System.getProperty("os.name"));  //输出	操作系统
		System.out.println(System.getProperty("os.arch"));
		System.out.println(System.getProperty("os.version"));
		
		System.out.println(System.getProperty("path.separator")); //输出    : on Unix || ; on Windows
		System.out.println(System.getProperty("file.separator")); //输出    / on Unix || \ on Windows
		
		System.out.println(System.getProperty("user.name"));
		System.out.println(System.getProperty("user.home"));
		
		System.out.println(System.getProperty("java.class.version"));
		
		System.setProperty("XXX", "efvrftb");
		System.out.println(System.getProperty("XXX"));
		
//		System.load("System.Properties.txt");//getProperties().load("System.Properties.txt");
//		System.getProperties().load(new InputStream(new File("System.Properties.txt")));
//		System.out.println(System.getProperties().getProperty("DBType"));
		
		try {
			Thread.sleep(3000);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
	}

	private static void File() {
		System.out.println(File.pathSeparator);	//输出	;
		System.out.println(File.separator); 	//输出	\
	}

}

